package com.atguigu.tingshu.album.config;

import com.qcloud.vod.VodUploadClient;
import com.tencentcloudapi.common.Credential;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "vod") //读取节点
@Data
public class VodConstantProperties {

    /**
     * 云点播应用AppID: 1361728305
     *
     * @SecretId:AKIDMn7HH7oKpBNMFD6lDUYPIzSo4EC0oaEi
     * @SecretKey:M8zsa5uXyCE5oPp23ryueBVcWYlrkU1P
     * @配置数据从nacos获取
     *
     * @子用户密钥
     * @SecretId:AKIDVyGNHyUp00zmMjtsiMovscGhx2tX0INF
     * @SecretKey:kJhua8UdZIrFZhePxIQO9IFzXs0zmOn2
     * */

    private Integer appId;
    private String secretId;
    private String secretKey;
    //https://cloud.tencent.com/document/api/266/31756#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8
    private String region;
    private String tempPath;

    /**
     * 声音文件上传客户端对象
     *
     * @return VodUploadClient vo上传客户端
     */
    @Bean
    public VodUploadClient vodUploadClient() {
        return new VodUploadClient(secretId, secretKey);
    }

    /**
     * 注册认证
     *
     * @return 认证对象
     */
    @Bean
    public Credential credential() {
        return new Credential(secretId, secretKey);
    }
}
